using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;

namespace LS.GameKit
{
    public class MultipleCommandHandler : CommandHandler
    {
        public List<CommandEventContent> events;

        public override void PerformCommand(CommandType command, params object[] args)
        {
            foreach (CommandEventContent content in this.events.Where(c => c.command == command))
            {
                content.commandEvent.Invoke();
            }
        }

        public class CommandEventContent
        {
            public CommandType command;
            public UnityEvent commandEvent;
        }
    }
}
